HatchShape AddRectangle2D
Adds a 2D Rectangle boundary to the HatchShape
Overloads
| public void AddRectangle2D(float lowerLeftX, float lowerLeftY, float upperRightX, float upperRightY, float angle) |
Return value
| void |
Parameters
| float | lowerLeftX | The x coordinate of the lower left X point of the rectangle |
| float | lowerLeftY | The y coordinate of the lower left Y point of the rectangle |
| float | upperRightX | The x coordinate of the Upper right X point of the rectangle |
| float | upperRightY | The y coordinate of the Upper right Y point of the rectangle |
| float | angle | The angle(radians) of rotation from the X direction in CCW, around the reference point. |
Example
Copy
scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);
if (scanDocument != null)
{
VectorImage vectorImage = scanDocument.CreateVectorImage("image1", DistanceUnit.Millimeters);
vectorImage.SetMarkSpeed(1000);
vectorImage.SetJumpSpeed(2000);
vectorImage.SetJumpDelay(100);
vectorImage.SetMarkDelay(100);
//Set Laser Delays
vectorImage.SetLaserOnDelay(10);
vectorImage.SetLaserOffDelay(10);
HatchShape hatchShape = new HatchShape();
hatchShape.AddRectangle2D(0, 0, 50, 50, 0);
hatchShape.AddLine(25, 0, 0, 25, 50, 0);
hatchShape.AddLine(30, 0, 0, 30, 50, 0);
hatchShape.AddHatchPatternLine(0, HatchLineBorderGapDirection.Inward, 0.254f,
0, 0, 0, HatchLineStyle.Unidirectional, true,
HatchOffsetAlgorithm.DirectOffset, HatchCornerStyle.Sharp);
vectorImage.AddHatch(hatchShape,0);
scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()"));
try
{
scanDocument.StartScanning();
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}